package com.example.mapper;

import com.example.common.Page;
import com.example.domain.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper

public interface ArticleMapper {
    void add(Article article);
    List<Article> page(Page<Article> page);
    int cunt(Page<Article> page);
    @Update("update article set title = #{title},text = #{text},update_time = #{updateTime} where id = #{id}")
    void update(Article article);
    @Select("select * from article where id = #{id}")
    Article getOne(String id);
    @Delete("delete from article where id = #{id}")
    void del(String id);
}
